import 'package:containerbox_study/Untils/api_response.dart';
import 'package:containerbox_study/Untils/http.dart';
import 'package:containerbox_study/schema/theme.dart';
import 'package:containerbox_study/value/api.dart';
import 'package:dio/dio.dart';

class LaoHuAPI{
  static Future getUserInfo() async {
    var response =
    await HttpsUtil.instance.post(Api.getUserInfo);
    return response.toString();
  }

  static Future <List<ThemeModel>> getThemeRealTopList() async{
    dynamic response = await HttpsUtil.instance.post(Api.getThemeRealTopList);
    final List<ThemeModel> themeModels = [];
    if (response != null) {
      final v = response['data'];
      v.forEach((item){
        themeModels.add(ThemeModel.fromJson(item));
      });
    }
    return themeModels;
  }
}